package com.ruoyi.locate.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.locate.mapper.WWarehouseMapScaleMapper;
import com.ruoyi.locate.domain.WWarehouseMapScale;
import com.ruoyi.locate.service.IWWarehouseMapScaleService;

/**
 * 仓位标尺Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-06 13:13:08
 */
@Service
public class WWarehouseMapScaleServiceImpl implements IWWarehouseMapScaleService 
{
    @Autowired
    private WWarehouseMapScaleMapper wWarehouseMapScaleMapper;

    /**
     * 查询仓位标尺
     * 
     * @param scaleId 仓位标尺主键
     * @return 仓位标尺
     */
    @Override
    public WWarehouseMapScale selectWWarehouseMapScaleByScaleId(Long scaleId)
    {
        return wWarehouseMapScaleMapper.selectWWarehouseMapScaleByScaleId(scaleId);
    }

    /**
     * 查询仓位标尺列表
     * 
     * @param wWarehouseMapScale 仓位标尺
     * @return 仓位标尺
     */
    @Override
    public List<WWarehouseMapScale> selectWWarehouseMapScaleList(WWarehouseMapScale wWarehouseMapScale)
    {
        return wWarehouseMapScaleMapper.selectWWarehouseMapScaleList(wWarehouseMapScale);
    }

    /**
     * 新增仓位标尺
     * 
     * @param wWarehouseMapScale 仓位标尺
     * @return 结果
     */
    @Override
    public int insertWWarehouseMapScale(WWarehouseMapScale wWarehouseMapScale)
    {
        wWarehouseMapScale.setCreateTime(DateUtils.getNowDate());
        return wWarehouseMapScaleMapper.insertWWarehouseMapScale(wWarehouseMapScale);
    }

    /**
     * 修改仓位标尺
     * 
     * @param wWarehouseMapScale 仓位标尺
     * @return 结果
     */
    @Override
    public int updateWWarehouseMapScale(WWarehouseMapScale wWarehouseMapScale)
    {
        wWarehouseMapScale.setUpdateTime(DateUtils.getNowDate());
        return wWarehouseMapScaleMapper.updateWWarehouseMapScale(wWarehouseMapScale);
    }

    /**
     * 批量删除仓位标尺
     * 
     * @param scaleIds 需要删除的仓位标尺主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseMapScaleByScaleIds(Long[] scaleIds)
    {
        return wWarehouseMapScaleMapper.deleteWWarehouseMapScaleByScaleIds(scaleIds);
    }

    /**
     * 删除仓位标尺信息
     * 
     * @param scaleId 仓位标尺主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseMapScaleByScaleId(Long scaleId)
    {
        return wWarehouseMapScaleMapper.deleteWWarehouseMapScaleByScaleId(scaleId);
    }

    /**
     * 清空w_warehouse_map_scale
     */
    @Override
    public int cleanWarehouseMapScale()
    {
        return wWarehouseMapScaleMapper.cleanWarehouseMapScale();
    }

    /**
     * 查询仓位标尺
     *
     * @param parentId 仓位标尺父Id
     * @return 仓位标尺
     */
    public List<WWarehouseMapScale> selectWWarehouseMapScaleByparentId(Long parentId)
    {
        return wWarehouseMapScaleMapper.selectWWarehouseMapScaleByparentId(parentId);
    }
}
